import React from 'react';
import { Layout } from 'antd';
import AppHeader from "@/layouts/partials/AppHeader";
import AppSider from "@/layouts/partials/AppSider";
import AppContent from "@/layouts/partials/AppContent";
import { useMenuProps } from '@/hooks';
import { menuProps } from '@/mock/menuProps'

export default ({ history }) => {
  const [menu, handleMenuClick] = useMenuProps(menuProps, history)

  const hasLayout = !history.location.pathname?.includes('/login')

  return (
    <Layout
      style={{
        height: '100vh',
        overflowY: 'hidden'
      }}
    >
      {/* {hasLayout && <AppHeader menu={menu} handleMenuClick={handleMenuClick} />} */}
      <Layout>
        {hasLayout && <AppSider menu={menu} handleMenuClick={handleMenuClick} />}
        <AppContent />
      </Layout>
    </Layout>
  )
}